#!/usr/bin/env python
# -*- coding: utf-8 -*-

# @Time     :2020/08/24
# @Author   :Changshu
# @File     :practice_101.py
# 101. 对称二叉树 给定一个二叉树，检查它是否是镜像对称的。

class TreeNode():
	def __init__(self,x):
		self.val=x
		self.left=None
		self.right=None


def check(p:TreeNode,q:TreeNode):
	if p==None and q==None:
		return True
	if p==None or q==None:
		return False
	return p.val==q.val and check(p.left,q.left) and check(p.right,q.right)

def isSymmetric(root:TreeNode)->bool:
	check(root,root)


# if __name__ == '__main__':
